package com.tanhua.server;

import com.tanhua.dubbo.api.UserLocationApi;
import com.tanhua.exeception.BusinessException;
import com.tanhua.interceptor.UserHolder;
import com.tanhua.model.vo.ErrorResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.prefs.BackingStoreException;

/**
 * @author 杰哥不要啦~
 * @date 2021/11/3
 */
@Service
public class BaiduService {

    @DubboReference
    private UserLocationApi userLocationApi;
    //更新地理位置

    public void updateLocation(Double longitude, Double latitude, String address) {
        Boolean flag = userLocationApi.updateLocaton(UserHolder.getUserid(),latitude,latitude,address);
        if (!flag){
            throw  new BusinessException(ErrorResult.error());
        }
    }
}
